package com.itheima.service;

import com.itheima.entity.PageResult;
import com.itheima.pojo.Permission;

import java.util.List;
import java.util.Map;

//权限管理模块
public interface PermissionsService {

    //分页查询权限
    PageResult findPage(String queryString, Integer pageSize, Integer currentPage);

    //查询所有权限
    List<Permission> queryAllPermissions();

    //添加权限
    void addPermissions(Permission permission);

    //回显权限
    Permission findById(Integer permissionsId);

    //编辑权限
    int editPermissions(Permission permission);

    //删除权限
    void deleteByPermissionsId(Integer id);

    //查看此权限是否关联角色
    int findPermissionsQueryRole(Integer id);

    //根据权限名和权限关键字查询权限
    Permission queryPermission(String name, String keyword);

    //根据权限id查询角色
    List<Map<String,String>> handleQueryRole(Integer permissionsId);

    //绑定角色
    void handleEditUser(Map<String, Integer> map, Integer[] roleIds);
}
